package com.yunfei.commonbase.base;

import com.yunfei.commonbase.base.entity.Example;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface BaseMapper<T extends  BaseEntity> {
    @SelectProvider(type = SqlProvider.class,method = "getListByExample")
    List<T> getListByExample(Example example,int pageNum ,int pageSize);

    @SelectProvider(type = SqlProvider.class,method = "getById")
    T getById( @Param("o") Object o, @Param("temp") Class c);

    @UpdateProvider(type = SqlProvider.class,method = "updateByExample")
    int updateByExample(T entity, Example example);

    @DeleteProvider(type = SqlProvider.class,method = "deleteByEntity")
    int deleteByEntity(T entity);

    @InsertProvider(type = SqlProvider.class,method = "insertEntity")
    int insertEntity(T entity);

}
